<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition template="/templates/principal_template.xhtml">
	<ui:define name="pageTitle">Login - jMed Systems</ui:define>
	<ui:define name="pageScrips"></ui:define>
	<ui:define name="pageCss"></ui:define>

	<ui:define name="imgTopContent"></ui:define>
	<ui:define name="imgTopLabelContent"></ui:define>
	<ui:define name="label_page_content"></ui:define>
	<p></p>

	<ui:define name="imgTopLabelContent">
		<p>Alterar Médico</p>
	</ui:define>

	<ui:define name="contentMain">
		<h:form id="form-alter-medico">
			<rich:panel>
				<h:panelGrid columns="2">

					<h:outputText value="Nome" />
					<h:inputText value="#{medicoControl.medicoSelect.nome}" />

					<h:outputText value="Auditor" />
					<h:selectBooleanCheckbox
						value="#{medicoControl.medicoSelect.auditor}" />

					<h:outputText value="CRM" />
					<h:inputText value="#{medicoControl.medicoSelect.crm}" />

					<h:outputText value="Especialidade" />
					<h:inputText value="#{medicoControl.medicoSelect.especialidade}" />

					<h:outputText value="Situação" />
					<h:selectOneRadio id="ativoMedico"
						value="#{medicoControl.medicoSelect.situacao}">
						<f:selectItem itemLabel="Ativo" itemValue="A" />
						<f:selectItem itemLabel="Inativo" itemValue="I" />
					</h:selectOneRadio>

					<h:commandButton action="#{medicoControl.alterarCadastroMedico()}"
						value="Alterar" />
					<h:commandButton action="/pages/medico/medicoBusca.xhtml"
						value="Voltar" />

				</h:panelGrid>
			</rich:panel>


			<rich:popupPanel id="dialogConfirmaAlterMedico" modal="true"
				autosized="true" resizeable="false" moveable="false">
				<f:facet name="header">
					<h:outputText value="Info - Alterar Medico" />
				</f:facet>

				<h:form>

					<h:panelGrid columns="1">
						<h:outputFormat value="Confirma alteração do Medico {0} ?">
							<f:param value="#{medicoControl.medicoSelect.nome}"></f:param>
						</h:outputFormat>
						<p></p>
						<h:panelGroup>
							<a4j:commandButton value="Sim"
								action="#{medicoControl.alterarCadastroMedico()}"
								oncomplete="#{rich:component('dialogConfirmaAlterMedico')}.hide(); return false;"></a4j:commandButton>

							<h:commandButton value="Não" immediate="true">
								<rich:componentControl target="dialogConfirmaAlterMedico"
									operation="hide" />
							</h:commandButton>

						</h:panelGroup>
					</h:panelGrid>
				</h:form>

			</rich:popupPanel>
		</h:form>
	</ui:define>
</ui:composition>

</html>